#!/bin/sh
version=1.0.7

docker build -t nezha:${version} .

docker tag nezha:${version} 192.168.50.149:88/lijin/nezha:${version}

docker push 192.168.50.149:88/lijin/nezha:${version}

curl -X PUT \
    -H "content-type: application/json" \
    -H "Cookie: KuboardUsername=admin; KuboardAccessKey=jaxpckky8iz7.xkfn5iiak85whzfc7ebfpdcn7r7kc8px" \
    -d '{"kind":"deployments","namespace":"nezha","name":"nezha","images":{"192.168.50.149:88/lijin/nezha":"192.168.50.149:88/lijin/nezha:'${version}'"}}' \
    "http://192.168.50.131:3080/kuboard-api/cluster/test-server/kind/CICDApi/admin/resource/updateImageTag"